﻿Imports DTO
Imports DAO
Imports System.Data.SqlClient
Imports System.Data.Sql
Public Class PinBUS
    Private pDAO As New PinDAO
    Public Shared Function ReadData() As List(Of PinDTO)
        Return PinDAO.ReadData()
    End Function
    Public Shared Function ReadDataTable() As DataTable
        Return PinDAO.ReadDataTable()
    End Function
    Public Shared Function ReadLoaiPin() As DataSet
        Return PinDAO.LoaiPin()
    End Function
    Public Shared Sub ImportExcel(ByVal path As String)
        PinDAO.ImportExcel(path)
    End Sub
    Public Sub InsertData(ByVal tenpin As String, ByVal maloai As Integer, ByVal congsuat As Integer, ByVal kichthuoc As String, ByVal hangsx As String, ByVal imp As Integer, ByVal vmp As Integer, ByVal isc As Integer, ByVal voc As Integer)
        Dim insert As New PinDAO
        insert.InsertData(tenpin, maloai, congsuat, kichthuoc, hangsx, imp, vmp, isc, vmp)
    End Sub
    Public Sub DeleteData(ByVal mapin As Integer)
        Dim delete As New PinDAO
        delete.DeleteData(mapin)
    End Sub
    Public Sub UpdateData(ByVal mapin As Integer, ByVal tenpin As String, ByVal maloai As Integer, ByVal congsuat As Integer, ByVal kichthuoc As String, ByVal hangsx As String, ByVal imp As Integer, ByVal vmp As Integer, ByVal isc As Integer, ByVal voc As Integer)
        Dim update As New PinDAO
        update.UpdateData(mapin, tenpin, maloai, congsuat, kichthuoc, hangsx, imp, vmp, isc, vmp)
    End Sub
    Public Function TimKiem(ByVal pin As PinDTO)
        Return pDAO.TimKiem(pin)
    End Function

    Public Function SelectById(ByVal id As Integer)
        Return pDAO.SelectByID(id)
    End Function
End Class
